package com.gitee.wsl.compose.chart.xy.bar.bullet

import androidx.compose.runtime.Composable

internal class ComparativeMeasure<T>(val value: T, val indicator: @Composable () -> Unit) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as ComparativeMeasure<*>

        if (value != other.value) return false
        if (indicator != other.indicator) return false

        return true
    }

    override fun hashCode(): Int {
        var result = value.hashCode()
        result = 31 * result + indicator.hashCode()
        return result
    }
}

internal data class FeaturedMeasure<T>(
    val value: T,
    val type: FeaturedMeasureType,
    val indicator: @Composable () -> Unit
) where T : Comparable<T>, T : Number

internal enum class FeaturedMeasureType {
    BAR, SYMBOL
}